import { PageData } from "~/rest";
import { FormulaGateway, PasterGateway } from "./dto.default";
import { Formula, Paster } from "./schema.default";

export const AssetRpcGetPasterPath = `${PasterGateway.path}/getPasterByIDs`;
export type getPasterRpcDto = { ids: Paster["id"][] };

export const AssetRpcGetFormulaPath = `${FormulaGateway.path}/getFormulaByIDs`;
export type getFormulaRpcDto = { ids: Formula["id"][] };

export const AssetRpcPutPasterSyncPath = `${PasterGateway.path}/putPasterSync`;
export type putPasterSyncRpcDto = { schema: Paster };

export interface AssetRpcInterfaceWithDerive<T> {
  getPasterByIDs(dto: T & getPasterRpcDto): Promise<PageData<Paster>>;
  getFormulaByIDs(dto: T & getFormulaRpcDto): Promise<PageData<Formula>>;

  putPasterSync(dto: T & putPasterSyncRpcDto): Promise<Paster>;
}
